package com.ruoyi.manage.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.manage.mapper.DeviceManageMapper;
import com.ruoyi.manage.domain.DeviceManage;
import com.ruoyi.manage.service.IDeviceManageService;

/**
 * 器械信息Service业务层处理
 * 
 * @author liuyangyang
 * @date 2025-06-04
 */
@Service
public class DeviceManageServiceImpl implements IDeviceManageService 
{
    @Autowired
    private DeviceManageMapper deviceManageMapper;

    /**
     * 查询器械信息
     * 
     * @param deviceId 器械信息主键
     * @return 器械信息
     */
    @Override
    public DeviceManage selectDeviceManageByDeviceId(Long deviceId)
    {
        return deviceManageMapper.selectDeviceManageByDeviceId(deviceId);
    }

    /**
     * 查询器械信息列表
     * 
     * @param deviceManage 器械信息
     * @return 器械信息
     */
    @Override
    public List<DeviceManage> selectDeviceManageList(DeviceManage deviceManage)
    {
        return deviceManageMapper.selectDeviceManageList(deviceManage);
    }

    /**
     * 新增器械信息
     * 
     * @param deviceManage 器械信息
     * @return 结果
     */
    @Override
    public int insertDeviceManage(DeviceManage deviceManage)
    {
        deviceManage.setCreateTime(DateUtils.getNowDate());
        return deviceManageMapper.insertDeviceManage(deviceManage);
    }

    /**
     * 修改器械信息
     * 
     * @param deviceManage 器械信息
     * @return 结果
     */
    @Override
    public int updateDeviceManage(DeviceManage deviceManage)
    {
        deviceManage.setUpdateTime(DateUtils.getNowDate());
        return deviceManageMapper.updateDeviceManage(deviceManage);
    }

    /**
     * 批量删除器械信息
     * 
     * @param deviceIds 需要删除的器械信息主键
     * @return 结果
     */
    @Override
    public int deleteDeviceManageByDeviceIds(Long[] deviceIds)
    {
        return deviceManageMapper.deleteDeviceManageByDeviceIds(deviceIds);
    }

    /**
     * 删除器械信息信息
     * 
     * @param deviceId 器械信息主键
     * @return 结果
     */
    @Override
    public int deleteDeviceManageByDeviceId(Long deviceId)
    {
        return deviceManageMapper.deleteDeviceManageByDeviceId(deviceId);
    }
}
